	{include file="Public:header" /}
		<div class="bar bar-nav">
			<h1 class="title">专家申请</h1>
			<i class="icon icon-left" onclick="window.history.go(-1);"></i>
		</div>
		<div class="content">
                    <form enctype="multipart/form-data" id="defaultForm" class="form-horizontal" action="{:U('Apply/expert_join')}" method="post">
			<div class="list-block join">
		    <ul>
		      <!-- Text inputs -->
                       <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">姓名：</div>
		            <div class="item-input">
		              <input type="text" placeholder="请输入姓名" name="user_name" value="{$apply.user_name}" class='form-control'>
		            </div>
		          </div>
		        </div>
		      </li>
		      <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">单位名称：</div>
		            <div class="item-input">
		              <input type="text" placeholder="请输入单位名称" name="job_name" value="{$apply.job_name}"  class='form-control'>
		            </div>
		          </div>
		        </div>
		      </li>
		      <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-email"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">申请类型：</div>
		            <div class="item-input">
                                <select name="type">
		              	<option value="1" {if condition="$apply.type eq 1"}selected{/if}>军事专家</option>
		              	<option value="2" {if condition="$apply.type eq 2"}selected{/if}>国防专家</option>
		              	<option value="3" {if condition="$apply.type eq 3"}selected{/if}>医学专家</option>
		              </select>
		            </div>
		          </div>
		        </div>
		      </li>
		      <li style='margin-bottom: 0px;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-password"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">联系电话：</div>
		            <div class="item-input">
		              <input type="tel" placeholder="请输入联系方式" name="phone"  value="{$apply.phone}"  class='form-control'>
		            </div>
		          </div>
		        </div>
		      </li>
                      <li style='border-top:0;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">E_mail：</div>
		            <div class="item-input">
		              <input type="text" placeholder="你的邮箱地址" name="email" value="{$apply.email}"  class='form-control'>
		            </div>
		          </div>
		        </div>
		      </li>
                      <li style='margin-top: 0px;border-top:0;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">视频连接：</div>
		            <div class="item-input">
		              <input type="text" placeholder="视频连接地址" name="video_url" value="{$apply.video_url}"  class='form-control'>
		            </div>
		          </div>
		        </div>
                          <span style="font-size: 12px;margin-left: 20px;color: green;">视频链接遵循http协议，如：http://www.baidu.com</span>
		      </li>
		      <!-- Date -->
                      <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-calendar"></i></div>
		          <div class="item-inner">
		            <div class="item-title label" style='width: 35%;'>一寸证件照：</div>
		            <div class="item-input" id="file-pretty">
                                <input type="file" name="headimgurl" class="form-control">
                              
		            </div>
                            
		          </div>
                          <input type="hidden" name="old_headimgurl" value="{$apply.headimgurl}" />
                          {if condition="$apply['img'] neq ''"}
                          <a target="_blank" href="__ROOT__{$apply.headimgurl}"><img src="{$apply.headimgurl}" style="width: 50px;height: 50px;margin-right: 10px;margin-top: 6px;"></a>
                                    
                           {/if}
		        </div>
                          <span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：图片尺寸建议为：413 X 295，图片小于1M</span>
		      </li>
		      <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-calendar"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">证明材料：</div>
		            <div class="item-input" id="file-pretty">
                                <input type="file" name="img" class="form-control">
                              
		            </div>
                            
		          </div>
                          <input type="hidden" name="old_img" value="{$apply.img}" />
                          {if condition="$apply['img'] neq ''"}
                          <a target="_blank" href="__ROOT__{$apply.img}"><img src="{$apply.img}" style="width: 50px;height: 50px;margin-right: 10px;margin-top: 6px;"></a>
                                    
                           {/if}
		        </div>
                          <span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：图片尺寸建议为：600*600，图片小于4M</span>
		      </li>
                       <li>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-calendar"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">上传照片墙：</div>
                            <div class="item-input" id="file_input" style='width: 60%;float: left'>
                                <input type="file" name="more_img[]" multiple class="form-control">
		            </div>
                            <a id="more_file_input" style='width: 30px;border-radius: 4px; color: #fff; font-weight: bold; font-size: 16px; text-align: center;display: block;background: #0894ec;'>  +  </a>
		        </div>
                          <input type="hidden" name="old_more_img" value="{$apply.more_img}" />
		        </div>
                          <span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：图片尺寸建议为：600*600，图片小于4M</span>
                          <div style='padding: 0 10px;'>
                           {if condition="$apply['more_img']"}
                          {volist name="apply['more_img_list']" id='vv'}
                          <!--<a target="_blank" href="__ROOT__{$vv}">-->
                              <img src="{$vv}" style="width: 50px;height: 50px;margin-right: 6px;margin-top: 6px;">
                          <!--</a>-->
                          {/volist}
                          {/if}
                          </div>
                          
		      </li>
                      <li class="align-top">
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-comment"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">个人简介：</div>
		            <div class="item-input">
                                <textarea placeholder="个人简介" name="introduce">{$apply.introduce}</textarea>
		            </div>
		          </div>
		        </div>
                          <!--<span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：250字以内</span>-->
		      </li>
		      <li class="align-top">
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-comment"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">个性签名：</div>
		            <div class="item-input">
                                <textarea placeholder="签名" name="signature">{$apply.signature}</textarea>
		            </div>
		          </div>
		        </div>
                          <!--<span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：250字以内</span>-->
		      </li>
		      <li class="align-top">
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-comment"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">补充说明：</div>
		            <div class="item-input">
                                <textarea placeholder="备注" name="explain">{$apply.explain}</textarea>
		            </div>
		          </div>
		        </div>
                          <!--<span style="font-size: 12px;margin-left: 20px;color: green;">温馨提示：内容不宜过长</span>-->
		      </li>
                      
                      <li style='border-top:0;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">审核结果：</div>
		            <div class="item-input">
		              {switch name="apply['status']"}
                              {case value="2"}<font color="#de9c00">待审核</font>{/case}
                                {case value="1"}<font color="#0894ec">审核通过</font>{/case}
                                {case value="3"}<font color="#f00">不通过</font>{/case}
                              {/switch}
		            </div>
		          </div>
		        </div>
		      </li>
                      {if condition="$apply['status'] eq 3"}
                      <li style='border-top:0;'>
		        <div class="item-content">
		          <div class="item-media"><i class="icon icon-form-name"></i></div>
		          <div class="item-inner">
		            <div class="item-title label">原因：</div>
		            <div class="item-input">
                                {$apply.reason}
		            </div>
		          </div>
		        </div>
		      </li>
                      {/if}
		    </ul>
		  </div>
		  <div class="content-block">
		    <div class="row">
		      <div class="col-100 text-center">
                          <!--<input type="submit" class="button button-big button-fill button-danger" value="提交">-->
                          <button class="button button-big button-fill button-danger" id='submitForm' style='width: 100%;'>提交</button>
                      </div>
		    </div>
		  </div>
                </form>
		</div>

	{include file="Public:footer" /}
        
        
<script>
    $('#more_file_input').click(function(){
         var number = $('#file_input input').length;
        if(number<10){
            $("#file_input").append('<div style="margin-top:5px"><input type="file" name="more_img[]" /></div>');
        }else{
            Zepto.toast('最多只能上传十张！', 2000, 'success top');
             return false;   
         }
    });
    
	var myreg = /(1[3-9]\d{9})$/;
	var true_or_false = true;
	$("#defaultForm").submit(function(){
		 var user_name = $("input[name='user_name']").val();
		 var job_name = $("input[name='job_name']").val();
		 var phone = $("input[name='phone']").val();
                 var email = $("input[name='email']").val();
                 var introduce = $("input[name='introduce']").val();
                 var headimgurl = $("input[name='headimgurl']").val();
		 var old_headimgurl = $("input[name='old_headimgurl']").val();
		 var email_regular = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;	//邮箱
		 var img = $("input[name='img']").val();
                 var old_img = $("input[name='old_img']").val();
		 if(user_name == ''){
			 Zepto.toast('请填写姓名！', 2000, 'success top');
			 return false;
		 }
		 if(job_name == ''){
			 Zepto.toast('请填写单位名称！', 2000, 'success top');
			 return false;
		 }
		 if(phone == ''){
			 Zepto.toast('请填写手机号码！', 2000, 'success top');
			 return false;
		 }
		 if(!myreg.test(phone)){
			 Zepto.toast('手机格式不正确！', 2000, 'success top');
			 return false;
		 }
		 if(email == ''){
			 Zepto.toast('请填写邮箱！', 2000, 'success top');
			 return false;
		 }
		 if(!email_regular.test(email)){ 
			 Zepto.toast('邮箱格式不正确！', 2000, 'success top');
			 return false;
	 	 }
                 if(introduce == ''){
			 Zepto.toast('请填写个人简介！', 2000, 'success top');
			 return false;
		 }
                 if((headimgurl == '') && (old_headimgurl == '')){
			 Zepto.toast('请上传一寸证件照！', 2000, 'success top');
			 return false;
		 }
		 if((img == '') && (old_img == '')){
			 Zepto.toast('请上传证明材料！', 2000, 'success top');
			 return false;
		 }

	});
	
	
</script>
</html>